package logic

import (
	"context"
	user "watermelon/common/proto"
	"watermelon/service/server"
)

type ServerUser struct {
	user.UnimplementedUserServer
}

func (s ServerUser) SendSms(ctx context.Context, in *user.SendSmsReq) (*user.SendSmsResp, error) {
	sms, err := server.SendSms(in)
	if err != nil {
		return nil, err
	}
	return sms, nil
}

func (s ServerUser) UserLogin(ctx context.Context, in *user.UserLoginReq) (*user.UserLoginResp, error) {
	login, err := server.UserLogin(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}
func (s ServerUser) UserItem(ctx context.Context, in *user.UserItemReq) (*user.UserItemResp, error) {
	item, err := server.UserItem(in)
	if err != nil {
		return nil, err
	}
	return item, nil
}
func (s ServerUser) ForgetPassword(ctx context.Context, in *user.ForgetPasswordReq) (*user.ForgetPasswordResp, error) {
	password, err := server.ForgetPassword(in)
	if err != nil {
		return nil, err
	}
	return password, nil
}
func (s ServerUser) UserCar(ctx context.Context, in *user.UserCarReq) (*user.UserCarResp, error) {
	car, err := server.UserCar(in)
	if err != nil {
		return nil, err
	}
	return car, nil
}
